import request from '@/utils/request'

export function list(query) {
  const data = {
    per_page: query.limit ? query.limit : '',
    page: query.page ? query.page : '',
    name: query.name ? query.name : ''
  }
  return request({
    url: '/api/backstage/encyclopedia/category',
    method: 'get',
    params: data
  })
}

export function create(data) {
  return request({
    url: '/api/backstage/encyclopedia/category',
    method: 'post',
    data
  })
}

export function update(data, id) {
  return request({
    url: '/api/backstage/encyclopedia/category/' + id,
    method: 'put',
    data
  })
}

export function deleteId(id) {
  return request({
    url: '/api/backstage/encyclopedia/category/' + id,
    method: 'delete'
  })
}
